<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>SeaJS Bootstrapping Test</title>
<style>
  iframe { width: 500px; height: 400px; margin: 10px; border: 1px solid #666; }
</style>
</head>
<body>

<div id="out"></div>

<script src="../../dist/sea.js"></script>

<script>

  var testCount = 0;

  function printResults(txt, style) {
    if (this.parent != this) {
      this.parent['printResults'](txt, style);
    }
    else {
      var d = document.createElement('div');
      d.innerHTML = txt;
      d.className = style;
      document.getElementById('out').appendChild(d);
    }
  }

  function createIframe(src) {
    var iframe = document.createElement('iframe');
    iframe.src = src;
    document.body.appendChild(iframe);
  }


  seajs.use('../test', function(test) {
    var n = 7;

    window.next = function() {
      if (--n === 0) {
        test.assert(testCount === 10, testCount);
        test.done();
      }
    };

    createIframe('sync-1.html');
    createIframe('sync-2.html');

    createIframe('async-1.html');
    createIframe('async-2.html');

    createIframe('multi-1.html');
    createIframe('multi-2.html');
    createIframe('multi-3.html');
  });

</script>
</body>
</html>